	 $(document).ready(function(){
	 	  //切换选项卡
                   $(".added img").click(function(){
                   $(".use").attr("src","/home/images/icon/center1.png");
                   var index = $(this).index();
                   $(this).addClass("cut").siblings().removeClass("cut");
                  $(".view-information").eq(index).show().siblings(".view-information").hide();
                  })
                  $(".use").click(function(){
                  	$(this).attr("src","/home/images/icon/center2.png");
                  $(".added img").removeClass("cut");
                  $(".view-information").css("display","none");
                  })
                  
           //长按删除    
               $.fn.longPress = function(fn) {
				    var timeout = undefined;
				    var $this = this;
				    for(var i = 0;i<$this.length;i++){
				        $this[i].addEventListener('touchstart', function(event) {
				            timeout = setTimeout(fn, 800);
				            }, false);
				        $this[i].addEventListener('touchend', function(event) {
				            clearTimeout(timeout);
				            }, false);
				    }
				}
		
		 $(document).ready(function(){
		   $(".room-delete").longPress(function(){
		    $(".delete").fadeIn();
		     $(".cancel").click(function(){
                	$(".delete").fadeOut();
                })
		     $(".del").click(function(){
                	$(".delete").fadeOut();
                	$(".no-room-pic").css("display","block");
                })
		});
		});
               
               
               //弹出保存div
                $(".device-room-three span:first-child").click(function(){
                	$(".pop-up").fadeIn();
                })
			  $(".cancel").click(function(){
                	$(".pop-up").fadeOut();
               })
			   $(".hold").click(function(){
                	$(".pop-up").fadeOut();
                    window.location.href="/home/dev/devrone";
                })
			 $(".device-room-three span:last-child").click(function(){
			 	window.location.href="/home/dev/devrone";
			 	 })
               
});